import service from '@/utils/request';

// 系统用户查询列表、分页
export function GetSysUserPage(params: {}) {
  return service({
    url: '/itf/permission/web/sys_user/page',
    method: 'get',
    params
  })
}

// 系统用户查询列表、不分页
export function GetSysUser(params: {}) {
  return service({
    url: '/itf/permission/web/sys_user',
    method: 'get',
    params
  })
}

// 系统用户新增
export function GetSysUserAdd(data: any) {
  return service({
    url: '/itf/permission/web/sys_user',
    method: 'post',
    data
  })
}

// pax信息
export function GetPaxInfo(params: any) {
  return service({
    url: `/itf/employee/web/employee/pax/uuid/${params.uuid}`,
    method: "get",
  });
}

// 系统用户修改uuid
export function PutSysUserUpdate(data: any) {
  return service({
    url: '/itf/permission/web/sys_user/uuid/' + data.uuid,
    method: 'put',
    data
  })
}

export function getDepartmentLists(data: object) {
  return service({
    url: '/itf/permission/web/department',
    method: 'get',
    data
  })
}

// 查询字典全量列表
export function queryDictKeys() {
  return service({
    url: '/itf/general/web/dict/info',
    method: 'get',
  })
}

// 查询单个字典数据
export function queryDictKey(value: string) {
  return service({
    url: `/itf/general/web/dict/data?dictKey=${value}`,
    method: 'get',
  })
}

// 重置用户密码
export function resetPassword(uuid: string, data: object) {
  return service({
    url: `/itf/permission/web/sys_user/password/reset/${uuid}`,
    method: "put",
    data,
  });
}

// 根据uuid查询详情
export function getUserInfo(uuid: string) {
  return service({
    url: `/itf/permission/web/sys_user/uuid/${uuid}`,
    method: 'get',
  })
}

// 用户账号解锁
export function userUnlock(uuid: string) {
  return service({
    url: `/itf/permission/web/sys_user/unlock/${uuid}`,
    method: "put",
  });
}

// 用户账号锁定
export function userLock(uuid: string) {
  return service({
    url: `/itf/permission/web/sys_user/lock/${uuid}`,
    method: "put",
  });
}

// 员工签证管理
export function addStaffVisa(data: {}) {
  return service({
    url: "/itf/employee/web/personal/document",
    method: "post",
    data,
  });
}
// 查询员工档案
export function queryStaffDocument(params: {}) {
  return service({
    url: "/itf/employee/web/personal/document",
    method: "get",
    params,
  });
}

// 根据uuid查询员工档案详情
export function queryStaffDocumentByUuid(uuid: any) {
  return service({
    url: `/itf/employee/web/personal/document/uuid/${uuid}`,
    method: "get",
  });
}
// 删除员工档案
export function deleteStaffVisa(uuid: string) {
  return service({
    url: `/itf/employee/web/personal/document/uuid/${uuid}`,
    method: "delete",
  });
}

// edit员工档案
export function editStaffVisa(uuid: string, data: {}) {
  return service({
    url: `/itf/employee/web/personal/document/uuid/${uuid}`,
    method: "put",
    data,
  });
}
// 查询员工
export function queryUsers(params: {}) {
  return service({
    url: `/itf/employee/web/employee/simple`,
    method: "get",
    params,
  });
}

//根据员工id查询详情;
export function queryUsersInfo(emplayeeId: number) {
  return service({
    url: `/itf/employee/web/employee/${emplayeeId}`,
    method: "get",
  });
}
